package vub.ngui.realquest.ui.custom;

import java.util.ArrayList;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.text.InputFilter.LengthFilter;
import android.widget.Toast;

import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.MapView;
import com.google.android.maps.OverlayItem;



	
	
	public class MiniGamesItemizedOverlay extends ItemizedOverlay<OverlayItem> {


		@Override
		public void draw(Canvas arg0, MapView arg1, boolean arg2) {
			// TODO Auto-generated method stub
			super.draw(arg0, arg1, false);
		}

		private ArrayList<OverlayItem> mOverlays = new ArrayList<OverlayItem>();
		private Context mContext;
		
		public MiniGamesItemizedOverlay(Drawable defaultMarker) {
			  super(boundCenterBottom(defaultMarker));
			}
		
		public MiniGamesItemizedOverlay(Drawable defaultMarker, Context context) {
			  super(boundCenterBottom(defaultMarker));
			  mContext = context;
			}
		
		public void addOverlay(OverlayItem overlay) {
			mOverlays.add(overlay);
		    populate();
		}
		
		@Override
		protected OverlayItem createItem(int i) {
		  return mOverlays.get(i);
		}
		
		@Override
		public int size() {
		  return mOverlays.size();
		}
		
		@Override
		protected boolean onTap(int index){
		  Toast.makeText(mContext, mOverlays.get(index).getTitle(), Toast.LENGTH_SHORT).show();	  
		  return true;
		}
	

}
